package com.server.questionbank.snframe.controller.Course.Details;


import com.server.questionbank.snframe.controller.Course.pojo.Details.CourseIntroduce;
import com.server.questionbank.snframe.domain.QuestionBank.Knowledge;
import com.server.questionbank.snframe.domain.ResDTO.ResponseResult;
import com.server.questionbank.snframe.service.CourseService.TCourseService;
import com.server.questionbank.snframe.service.CourseService.TKnowledgeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/course/details/introduce")
public class CourseIntroduceController {
    @Autowired
    private TCourseService tCourseService;

    // 设置课程介绍
    @PostMapping("/setText")
    public ResponseResult<Void> setCourseIntroduce(@RequestBody CourseIntroduce courseIntroduce) {
        if (tCourseService.setCourseIntroduce(courseIntroduce.getCourseId(),
                courseIntroduce.getCourseIntroduce())
        ) {
            return ResponseResult.success("保存成功", null);
        }
        return ResponseResult.error("保存失败!");
    }

}
